﻿<%@ Page Language="C#" MasterPageFile="~/Members/Members.master" AutoEventWireup="true"
    CodeFile="chinh-sua-tin-dang.aspx.cs" Inherits="Members_chinh_sua_tin_dang" Title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/Members/Upload.ascx" TagName="Upload" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <center>
        <h2>
            Chỉnh sửa tin đã đăng
            <asp:Label ID="lblInfo" runat="server"></asp:Label>
        </h2>
        <div>
            <center>
                <asp:TextBox ID="txtProductID" Visible="true" runat="server"></asp:TextBox>
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                </telerik:RadScriptManager>
                <telerik:RadAjaxLoadingPanel runat="server" ID="loading1" EnableSkinTransparency="true">
                </telerik:RadAjaxLoadingPanel>
                <telerik:RadAjaxManager runat="server" ID="manager1" DefaultLoadingPanelID="loading1">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="cboChuyenMuc" EventName="cboChuyenMuc_Changed">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="cboNeeds" />
                                <telerik:AjaxUpdatedControl ControlID="cboChungLoai" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="cboNoiRao" EventName="cboNoiRao_Changed">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="cboQuanHuyen" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <table class="form" cellpadding="0" cellspacing="0" style="text-align: left">
                    <tr>
                        <td colspan="3">
                            <div class="form-title">
                                Chỉnh sửa lại bài đăng</div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Tiêu đề
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtProductName"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator runat="server" ID="require1" ControlToValidate="txtProductName"
                                ErrorMessage="Bạn phải nhập tiêu đề của tin" Display="Dynamic"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Ảnh :
                        </td>
                        <td>
                            <asp:TextBox ID="txtProductImage" runat="server" Width="520px" MaxLength="500"></asp:TextBox>
                            <uc1:Upload ID="Upload2" runat="server" Enabled="true"></uc1:Upload>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            Giá
                        </td>
                        <td>
                            <asp:RadioButtonList runat="server" ID="cboPrice" AutoPostBack="true" CausesValidation="false"
                                RepeatColumns="2" RepeatLayout="Flow" OnSelectedIndexChanged="cboPrice_Changed">
                                <asp:ListItem Text="Thỏa thuận" Value="1"></asp:ListItem>
                                <asp:ListItem Text="Giá chính xác" Value="2"></asp:ListItem>
                            </asp:RadioButtonList>
                            <div>
                                <asp:TextBox runat="server" ID="txtProductPrice" Visible="false" Text="-1" EnableViewState="true"></asp:TextBox>
                                <asp:DropDownList runat="server" ID="cboCurrency" Visible="false">
                                    <asp:ListItem Text="VND" Value="VND"></asp:ListItem>
                                    <asp:ListItem Text="USD" Value="USD"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator7" ControlToValidate="txtProductName"
                                ErrorMessage="Bạn phải nhập giá của sản phẩm" Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator runat="server" ID="req" ControlToValidate="txtProductPrice"
                                ErrorMessage="Giá bạn nhập không hợp lệ" ValidationExpression="\d{1,10}"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Chuyên mục
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="cboChuyenMuc" DataTextField="FunctionPageName"
                                DataValueField="FunctionPageID" AppendDataBoundItems="true" AutoPostBack="true"
                                OnSelectedIndexChanged="cboChuyenMuc_Changed">
                                <asp:ListItem Text="Không có nhóm cha" Value="none"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="cboChuyenMuc"
                                InitialValue="none" ErrorMessage="Bạn phải chọn chuyên mục" Display="Dynamic"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Nhu cầu
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="cboNeeds" DataTextField="NeedsName" DataValueField="NeedsID"
                                AppendDataBoundItems="true">
                                <asp:ListItem Text="Không có nhóm cha" Value="none"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="cboNeeds"
                                InitialValue="none" ErrorMessage="Bạn phải chọn loại nhu cầu" Display="Dynamic"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Chủng loại
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="cboChungLoai" DataTextField="FunctionPageName"
                                DataValueField="FunctionPageID" AppendDataBoundItems="true">
                                <asp:ListItem Text="Không có nhóm cha" Value="none"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="cboChungLoai"
                                ErrorMessage="Bạn phải chọn chủng loại của tin" Display="Dynamic"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Nơi rao
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="cboNoiRao" AutoPostBack="true" OnSelectedIndexChanged="cboNoiRao_Changed"
                                AppendDataBoundItems="true" DataTextField="LocationName" DataValueField="LocationID">
                                <asp:ListItem Text="Tất cả địa điểm" Value="0"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Quận huyện
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="cboQuanHuyen" DataTextField="LocationName" DataValueField="LocationID">
                                <asp:ListItem Text="Tất cả quận huyện" Value="0"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <span>Nội dung</span>
                            <telerik:RadEditor runat="server" ID="txtProductContent">
                            </telerik:RadEditor>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <asp:Button runat="server" ID="btnSubmit" OnClick="btnSubmit_Click" Text="Đăng tin" />
                        </td>
                    </tr>
                </table>
            </center>
        </div>
    </center>
</asp:Content>
